﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessLayer;
using Entities;
using System.Data;

namespace BusinessLogicLayer
{
    public class ChiTietHoaDonBO
    {
        private ChiTietHoaDonDAL dal;
        public ChiTietHoaDonBO()
        {
            try
            {
                dal = new ChiTietHoaDonDAL();
            }
            catch (Exception e)
            {
                throw new BusinessLogicException();
            }
        }
        public int GetTongSachBanTrongThang(string thang, string nam, int maSach)
        {
            int kq = 0;
            try
            {
                kq = dal.GetTongSachBanTrongThang(thang, nam, maSach);
            }
            catch (Exception)
            {
                return kq;
                throw;
            }
            return kq;
        }
        public int DeleteChiTietHoaDon(string maHoaDon)
        {
            int dt = 0;
            try
            {
                dt = dal.DeleteChiTietHoaDon(maHoaDon);
                return dt;
            }
            catch (Exception)
            {
                return dt;
                throw;
            }

        }
        public DataTable GetChiTietHoaDonByID(int id)
        {
            DataTable dt = null;
            try
            {
                dt = dal.GetChiTietHoaDonByID(id);
            }
            catch (Exception)
            {
                throw;
            }
            return dt;
        }
    }
}
